/*
	复制文件
*/
#include <iostream>
#include <fstream>
#include <cassert>
using namespace std;

int main(int argc, char * argv[]) {

	if(argc != 3) {
		cout << "Usage : " << endl;
		cout << "\t " << argv[0] << " oldfile newfile " << endl;
		return -1;
	}

	char ch;
	ifstream in(argv[1], ios::binary);
	if(! in) {
		cout << "File " << argv[1] << " is not exist." << endl;
		return -2;
	}

	ofstream out(argv[2], ios::binary);
	while(in.get(ch)) {
		out << ch;
	}

	in.close();
	out.close();

	return 0;
} 
